package com.neu.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.neu.entity.RegistLevel;
import com.neu.service.RegistLevelService;
import com.neu.util.JsonResult;
import com.neu.util.ResultCode;




@CrossOrigin
@RestController
@RequestMapping("/his/registlevel")
public class RegistLevelController {
	public static final Integer ok = 200;
		@Autowired
		private RegistLevelService registLevelService;
//		添加挂号级别
		@PostMapping("/add_register")
		public JsonResult<Boolean> addRegistLevel(@RequestBody RegistLevel registLevel) {
			boolean save =  registLevelService.addRegistLevel(registLevel);
			if(save) {
				return new JsonResult<Boolean>(ResultCode.SUCCESS,save);
			}else {
				return new JsonResult<Boolean>(ResultCode.INSERT_ERROR,save);
			}
				
		}
//		删除挂号级别通过id
		@PostMapping("/delete_register")
		public JsonResult<Boolean> delRegistLevel(@RequestParam("id") int id) {

				return new JsonResult<Boolean>();
				
		}
//		修改挂号级别
		@PostMapping("/update_register")
		public JsonResult<Boolean> updateRegistLevel(@RequestBody RegistLevel registLevel) {


				return new JsonResult<Boolean>();

				
		}
//		分页查询挂号级别
		@GetMapping("/get_register")
		public JsonResult<List<RegistLevel>> pageRegistLevel(
			 @RequestParam("page")	int page,
			 @RequestParam("limit") int limit) {



			return new JsonResult<List<RegistLevel>>();
		}
		
}
